/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2024 STMicroelectronics.
  * All rights reserved.
  *
  * This software is licensed under terms that can be found in the LICENSE file
  * in the root directory of this software component.
  * If no LICENSE file comes with this software, it is provided AS-IS.
  *
  ******************************************************************************
  */
/* USER CODE END Header */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32g4xx_hal.h"

/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */

/* USER CODE END Includes */

/* Exported types ------------------------------------------------------------*/
/* USER CODE BEGIN ET */

/* USER CODE END ET */

/* Exported constants --------------------------------------------------------*/
/* USER CODE BEGIN EC */

/* USER CODE END EC */

/* Exported macro ------------------------------------------------------------*/
/* USER CODE BEGIN EM */

/* USER CODE END EM */

/* Exported functions prototypes ---------------------------------------------*/
void Error_Handler(void);

/* USER CODE BEGIN EFP */

/* USER CODE END EFP */

/* Private defines -----------------------------------------------------------*/
#define MCPWM_CLOCK_HZ 168000000
#define MCPWM_DEADTIME_CLOCKS 20
#define MCPWM_TGRO_TIME MCPWM_PERIOD_CLOCKS-10
#define MCPWM_RCR 0
#define MCPWM_FREQ 20000
#define MCPWM_PERIOD_CLOCKS MCPWM_CLOCK_HZ/2/MCPWM_FREQ
#define LED1_Pin GPIO_PIN_13
#define LED1_GPIO_Port GPIOC
#define LED2_Pin GPIO_PIN_14
#define LED2_GPIO_Port GPIOC
#define LED3_Pin GPIO_PIN_15
#define LED3_GPIO_Port GPIOC
#define ADC2_IN6_VA_Pin GPIO_PIN_0
#define ADC2_IN6_VA_GPIO_Port GPIOC
#define ADC2_IN7_VB_Pin GPIO_PIN_1
#define ADC2_IN7_VB_GPIO_Port GPIOC
#define ADC2_IN8_VC_Pin GPIO_PIN_2
#define ADC2_IN8_VC_GPIO_Port GPIOC
#define ADC1_IN1_IC_Pin GPIO_PIN_0
#define ADC1_IN1_IC_GPIO_Port GPIOA
#define ADC1_IN2_IB_Pin GPIO_PIN_1
#define ADC1_IN2_IB_GPIO_Port GPIOA
#define ADC1_IN3_IA_Pin GPIO_PIN_2
#define ADC1_IN3_IA_GPIO_Port GPIOA
#define ADC1_IN4_IBUS_Pin GPIO_PIN_3
#define ADC1_IN4_IBUS_GPIO_Port GPIOA
#define DAC_Pin GPIO_PIN_4
#define DAC_GPIO_Port GPIOA
#define ADC2_IN5_ADSPE_Pin GPIO_PIN_4
#define ADC2_IN5_ADSPE_GPIO_Port GPIOC
#define ADC2_IN11_VBUS_Pin GPIO_PIN_5
#define ADC2_IN11_VBUS_GPIO_Port GPIOC
#define ADC1_IN12_NTC1_Pin GPIO_PIN_1
#define ADC1_IN12_NTC1_GPIO_Port GPIOB
#define ADC2_IN12_NTC2_Pin GPIO_PIN_2
#define ADC2_IN12_NTC2_GPIO_Port GPIOB
#define ADC1_IN11_NTC3_Pin GPIO_PIN_12
#define ADC1_IN11_NTC3_GPIO_Port GPIOB
#define KEY4_Pin GPIO_PIN_6
#define KEY4_GPIO_Port GPIOC
#define KEY4_EXTI_IRQn EXTI9_5_IRQn
#define KEY3_Pin GPIO_PIN_7
#define KEY3_GPIO_Port GPIOC
#define KEY3_EXTI_IRQn EXTI9_5_IRQn
#define KEY2_Pin GPIO_PIN_8
#define KEY2_GPIO_Port GPIOC
#define KEY2_EXTI_IRQn EXTI9_5_IRQn
#define KEY1_Pin GPIO_PIN_9
#define KEY1_GPIO_Port GPIOC
#define KEY1_EXTI_IRQn EXTI9_5_IRQn
#define LCD_RES_Pin GPIO_PIN_15
#define LCD_RES_GPIO_Port GPIOA
#define LCD_SCK_Pin GPIO_PIN_10
#define LCD_SCK_GPIO_Port GPIOC
#define LCD_DC_Pin GPIO_PIN_11
#define LCD_DC_GPIO_Port GPIOC
#define LCD_SDA_Pin GPIO_PIN_12
#define LCD_SDA_GPIO_Port GPIOC
#define SPI1_CS_Pin GPIO_PIN_2
#define SPI1_CS_GPIO_Port GPIOD
#define LCD_CS_Pin GPIO_PIN_6
#define LCD_CS_GPIO_Port GPIOB
#define LCD_BLK_Pin GPIO_PIN_7
#define LCD_BLK_GPIO_Port GPIOB

/* USER CODE BEGIN Private defines */

/* USER CODE END Private defines */

#ifdef __cplusplus
}
#endif

#endif /* __MAIN_H */
